Get IP and geolocation class sharing in PHP, IP geolocation
Before we found a script that didn't finish, it simply expanded.Getting IP is using classic logic, and geo-targeting uses the generic interface of Sina.
The use of the method see source code:
Copy CodeThe code is a
Overview
This report summarizes a pair of programming projects. I (Lin Meng) and Li yazhao jointly completed this project.
The goal of the project is to obtain the geographical location information of the user through the user's IP address when the user accesses the academic map, so as to reposition the map and set the location of the user as the center currently displayed. This function is available on many network maps, such as Bing map and Googl
IP geolocation Query class
/**
File name: IpLocation.class.php
* IP Geo-Location query class (Master file I'm uploading it.) I upload a test file, and there is a QQWry.Dat this can be downloaded to the pure IP library because there are more than 6M so here do not upload it up.
*
A gadget that displays IP geolocation information under Linux-naliFirst, IntroductionNali, the name is taken from the Chinese "where" pinyin. Nali contains a set of command-line programs whose main function is to attach the IP strings of the output of some network tools to the location information (using the Pure database
#./configure# Make make installIv. Updating IP databasesYou can use the Nali-update command to update the IP database/usr/local/share/qqwry.dat This file needs to be updated frequently, otherwise the error will be relatively large.V. Use of5.1. Nali# Nali 74.125.128.106# Nali 61.135.169.1055.2. Nali-dig# Nali-dig www.google.com5.3. Nali-nslookup# nali-nslookup w
#./configure# Make make installIv. Updating IP databasesYou can use the Nali-update command to update the IP database/usr/local/share/qqwry.dat This file needs to be updated frequently, otherwise the error will be relatively large.V. Use of5.1. Nali# Nali 74.125.128.106# Nali 61.135.169.1055.2. Nali-dig# Nali-dig www.google.com5.3. Nali-nslookup# nali-nslookup w
to dig |nali)Second, download# wget--no-check-certificate http://qqwry.googlecode.com/files/nali-0.2.tar.gzThird, installation# tar ZXVF nali-0.2.tar.gz# CD nali-0.2#./configure# Make make installIv. Updating IP databasesYou can use the Nali-update command to update the IP database/usr/local/share/qqwry.dat This file needs to be updated frequently, otherwise th
First, IntroductionNali, the name is taken from the Chinese "where" pinyin. Nali contains a set of command-line programs whose main function is to attach the IP strings of the output of some network tools to the location information (using the Pure database QQWry.Dat). For example, 74.125.128.104 will become 74.125.128.104[the California Mountain View of the United States Google Inc.]. Queries are made loca
It turns out that you need to turn IP into decimal.
Copy the Code code as follows:
$ip = $_server[' remote_addr ');echo ' Your IP: '. $ip. '';$ip _arr = Explode (".", $ip);$ip = 0;fo
The IP address recorded in the text database. if the IP address already exists, it will not be added. if the IP address does not exist, it will be recorded in the text data. there will be a total of debugging errors. Document 1: lt ;? Optional quot; text data storage file nbsp; $ oldfile ($ ipfile); nbsp; $ num
Discuz 5.0 is not using their own IP data, but the use of pure IP data format, access to the pure IP database a little bit of trouble, its storage format is very special and interesting, specific format analysis refer to the following two links, other languages to implement the link at the end of the reference article.
Reprinted from: http://www.cnblogs.com/efreer/archive/2008/12/12/1353410.html
Newest coral worm IP database http://update.cz88.net/soft/qqwry.rar
Microsoft Office Access 2003
Eiditplus
MS sql2005
1. Open showip.exe, which is included in the IP address database of the coral worm, and extract it. save another TXT fi
Php query IP location (dat database)-If someone shares a pure IP database, share a classic query using a pure IP database, I believe many people have seen or even used this code. But you may not know that this code is actually cha
The pure version of IP data files can be used to optimize the query method, improve the format conversion efficiency, reduce the number of file reads, and quickly query IP addresses online. Greatly reduce the number of file reads, which should be beneficial to protecting the server's hard disk. Add a database browser to view the qq
/**
* Get city name based on IP address pure IP database
* edit:bbs.it-home.org
*/
function Convertip ($IP) {
IP Data File path
$dat _path = ' QQWry.Dat ';
Check IP Address
if (!filter
Php queries the region (pure ip database) based on the ip address ). Pure ip library download? PhpclassIpLocation {*** @ varresource pointer * private $ fp; *** offset address of the first IP record * @ varint * private $ firstip; * ** download the last
The application IP address of the pure IP database is converted to decimal. The original code for copying an IP address in decimal format is as follows: $ ip $ _ SERVER [REMOTE_ADDR]; echo your IP address :. $ ip.br; $ ip_arrexplo
Tags: SQL Windows clusterCurrently the database server has three, the operating system version of Windows Server R2 with SP1, the database version is SQL Server standard R2, three database server computer name and IP address are as follows:sqlsrv-001:10.0.0.11,sqlsrv-002:10.0.0.12,sqlsrv-003:10.0.0.13,Server cluster
High-performance IP database format qqzeng-ip.dat, ip. datHigh Performance IP database format qqzeng-ip.dat
Encoding:UTF8Byte order:Little-Endian
Multiple fields are returned.(For example, Asia | China | Hong Kong | Kowloon | youqiwang | New World TELECOM | 810200 | Hong Kon
Text database record IP, if the IP is not added, no record to the text data, debug total error, help master
Document One:
$now _time=time ();//Current time
$ipfile = "./images/ip.txt";//Text data storage file
$old =file ($ipfile);
$num =count ($old);
for ($i =0; $i List ($txtusre, $txtzzip, $txttime) =explode ("|", $old [$i]);
if ($txtzzip = = "$REMOTE _addr")
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.